package com.boco.blch.runner.result.handler;

import com.boco.blch.runner.executor.AbstractExecutor;
import com.boco.blch.runner.result.Result;

public class TrimResultForAIX extends TrimResult {
	
	@Override
	public Result handler(Result r) {
		String result = r.getMessage();
		String[] ll = result.split(EXESHELL_REGEX);
		if(ll != null && ll.length != 0){
			String trueResult = ll[ll.length - 1];
			r.setMessage(trueResult);
			if(trueResult.indexOf(AbstractExecutor.EOF) >= 0){
				String[] lll = trueResult.split(AbstractExecutor.EOF);
				r.setMessage(lll[0]);
			}
		}
		return r;
	}
}
